package org.lc.stk.model.course;

import java.util.List;

import org.hibernate.annotations.Comment;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToMany;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;

/**
 * 知识点
 */
@Entity
@Table(name = "knowledgePoint")
@Comment("知识点")
public class KnowledgePoint {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    @Column
    @Comment("知识点名称")
    private String name;

    @ManyToOne
    @Comment("课程")
    private Course course;

    @ManyToOne
    @Comment("章节")
    private Chapter chapter;

    @ManyToMany
    @Comment("前置知识点")
    private List<KnowledgePoint> preKnowledges;

    // todo 不知道好不好使
    @ManyToMany(mappedBy = "preKnowledges")
    @Comment("后置知识点")
    private List<KnowledgePoint> nextKnowledges;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Chapter getChapter() {
        return chapter;
    }

    public void setChapter(Chapter chapter) {
        this.chapter = chapter;
    }

    public List<KnowledgePoint> getPreKnowledges() {
        return preKnowledges;
    }

    public void setPreKnowledges(List<KnowledgePoint> preKnowledges) {
        this.preKnowledges = preKnowledges;
    }

    public List<KnowledgePoint> getNextKnowledges() {
        return nextKnowledges;
    }

    public void setNextKnowledges(List<KnowledgePoint> nextKnowledges) {
        this.nextKnowledges = nextKnowledges;
    }

    public Course getCourse() {
        return course;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    
    
}
